<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


<!doctype html>
<html lang="zh">
    <style>
/* 容器样式 */
.aircraft-list-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

/* 头部样式 */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-add {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.3s;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    color: white;
}

/* 表格样式 */
.aircraft-table {
    width: 100%;
    border-collapse: collapse;
}

.aircraft-table th {
    background: #f8f9fa;
    color: #64748b;
    font-weight: 600;
    padding: 1.2rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.aircraft-table td {
    padding: 1.2rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* 状态徽章 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.status-badge.可用 {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-badge.维修中 {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-badge.停飞 {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* 操作按钮 */
.btn-edit {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-edit:hover {
    background: #6366f1;
    color: white;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .aircraft-table th,
    .aircraft-table td {
        padding: 1rem;
    }
    
    .btn-edit {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
</style>
    </style>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="通辽航空管理平台 ">
		<title>通辽航空管理平台 </title>
		<link rel="stylesheet" href="css/bootstrap.min.css">
		<link rel="stylesheet" href="fonts/style.css">
		<link rel="stylesheet" href="css/main.css">
		<link rel="stylesheet" href="css/css.css">

	</head>
	<body>
		<header class="header">
			<div class="container-fluid">
				<div class="row gutters">
					<div class="col-xl-4 col-lg-4 col-md-4 col-sm-4 col-9">
						<a href="admin_index.jsp" class="logo"> <img src="img/logo.png">通辽航空管理平台  </a>
					</div>
					<div class="col-xl-8 col-lg-8 col-md-8 col-sm-8 col-3">
						<ul class="header-actions">
							<li class="dropdown d-none d-sm-block">

								<div class="dropdown-menu lrg" aria-labelledby="notifications">
									<div class="dropdown-menu-header">
										<h5>Notifications</h5>
										<p class="m-0 sub-title">You have 5 unread notifications</p>
									</div>	
									<ul class="header-notifications">
											<li>
												<a href="#" class="clearfix">
													<div class="avatar">
														<img src="img/user24.png" alt="avatar" />
														<span class="notify-iocn icon-drafts text-danger"></span>
													</div>
													<div class="details">
														<h6>Dr. Clive</h6>
														<p>Appointed as a new President 2019-2020</p>
													</div>
												</a>
											</li>
											<li>
												<a href="#" class="clearfix">
													<div class="avatar">
														<img src="img/user21.png" alt="avatar" />
														<span class="notify-iocn icon-layers text-info"></span>
													</div>
													<div class="details">
														<h6>Dr. G. Levsmia</h6>
														<p>Will be on leave on October 2nd week.</p>
													</div>
												</a>
											</li>
											<li>
												<a href="#" class="clearfix">
													<div class="avatar">
														<img src="img/user19.png" alt="avatar" />
														<span class="notify-iocn icon-person_add text-success"></span>
													</div>
													<div class="details">
														<h6>Dr. George S</h6>
														<p>Sent new applointments list</p>
													</div>
												</a>
											</li>
										</ul>
								</div>
							</li>
							<li class="dropdown">
								<a href="#" id="userSettings" class="user-settings" data-toggle="dropdown" aria-haspopup="true">
									<span class="user-name">管理员</span>
									<span class="avatar">NR<span class="status busy"></span></span>
								</a>
								<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userSettings">
									<div class="header-profile-actions">

										<a href="hospital-add-doctor.html"><i class="icon-user1"></i> My Profile</a>
										<a href="account-settings.html"><i class="icon-settings1"></i> Account Settings</a>
										<a href="hospital-reviews.html"><i class="icon-activity"></i> Activity Logs</a>
										<a href="login.html"><i class="icon-log-out1"></i> Sign Out</a>
									</div>
								</div>
							</li>
						</ul>						
					</div>
				</div>
			</div>
		</header>
		<div class="container-fluid">
			<!-- Navigation start -->
			<nav class="navbar navbar-expand-lg custom-navbar">
				<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#royalHospitalsNavbar" aria-controls="royalHospitalsNavbar" aria-expanded="false" aria-label="Toggle navigation">
					<span class="navbar-toggler-icon">
						<i></i>
						<i></i>
						<i></i>
					</span>
				</button>
				<div class="collapse navbar-collapse" id="royalHospitalsNavbar">
					<ul class="navbar-nav">
						<li class="nav-item">
							<a class="nav-link " href="FlightsServlet?pageNo=1">
								<i class="icon-home nav-icon"></i>
								首页</a>
						</li>
						<li class="nav-item dropdown">
							<a class="nav-link dropdown-toggle" href="#" id="doctoRs" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
								<i class="icon-person_pin nav-icon"></i>
								数据录入
							</a>
							<ul class="dropdown-menu" aria-labelledby="doctoRs">
								<li><a class="dropdown-item" href="flight_insert.jsp">录入航班</a></li>
								<li><a class="dropdown-item" href="aircraft_insert.jsp">录入飞机</a></li>
							</ul>
						</li>
					
						<li class="nav-item dropdown">
							<a class="nav-link dropdown-toggle" href="#" id="formsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
								<i class="icon-assignment_turned_in nav-icon"></i>
								申请管理
							</a>
							<ul class="dropdown-menu" aria-labelledby="formsDropdown">
								<li><a class="dropdown-item " href="QuitsServlet?pageNo=1">退票申请列表</a></li>
								<li><a class="dropdown-item active-page" href="AuditsServlet?pageNo=1">改签申请列表</a></li>
							</ul>
						</li>
						<li class="nav-item dropdown">
							<a class="nav-link dropdown-toggle active-page " href="#" id="uiElementsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
								<i class="icon-assignment nav-icon"></i>
								数据管理
							</a>
							<ul class="dropdown-menu " aria-labelledby="uiElementsDropdown">
								<li><a class="dropdown-item" href="${pageContext.request.contextPath}/UserList?pageNo=1">用户数据管理</a></li>
								<li><a class="dropdown-item active-page" href="${pageContext.request.contextPath}/AircraftListServlet?pageNo=1">飞机数据管理</a></li>

							</ul>
						</li>
						<li class="nav-item dropdown">
							<a class="nav-link dropdown-toggle" href="#" id="loginDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
								<i class="icon-burst_mode nav-icon"></i>
								注册申请 
							</a>
							<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="loginDropdown">
								<li><a class="dropdown-item " href="RegisterListServlet?pageNo=1">用户注册申请</a></li>
							</ul>
						</li>
					
					</ul>
				</div>
			</nav>
			<div class="main-container">
				<div class="page-header">
					<ol class="breadcrumb">
						<li class="breadcrumb-item">数据管理</li>
						<li class="breadcrumb-item active">飞机数据管理</li>
					</ol>
				</div>


                <div class="content-wrapper">
                    <div class="aircraft-list-container">
                        <!-- 标题和新增按钮 -->
                        <div class="list-header">
                            <h3><i class="fas fa-plane me-2"></i>飞机列表</h3>
                            <a href="aircraft_insert.jsp" class="btn-add">
                                <i class="fas fa-plus-circle me-2"></i>新增飞机
                            </a>
                        </div>
                
                        <!-- 数据表格 -->
                        <div class="table-responsive">
                            <table class="aircraft-table">
                                <thead>
                                    <tr>
                                        <th style="width: 20%">飞机编号</th>
                                        <th style="width: 25%">机型</th>
                                        <th style="width: 20%">当前状态</th>
                                        <th style="width: 15%">最大座位</th>
                                        <th style="width: 20%">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <c:choose>
                                        <c:when test="${not empty list}">
                                            <c:forEach items="${list}" var="aircraft">
                                                <tr>
                                                    <!-- 飞机编号 -->
                                                    <td>
                                                        <div class="aircraft-id">
                                                            <i class="fas fa-fingerprint me-2"></i>
                                                            ${aircraft.aircraftId}
                                                        </div>
                                                    </td>
                                                    
                                                    <!-- 机型 -->
                                                    <td>
                                                        <span class="model-badge">
                                                            <i class="fas fa-tag me-2"></i>
                                                            ${aircraft.model}
                                                        </span>
                                                    </td>
                                                    
                                                    <!-- 状态 -->
                                                    <td>
                                                        <span class="status-badge ${aircraft.currentStatus}">
                                                            <c:choose>
                                                                <c:when test="${aircraft.currentStatus == '可用'}">
                                                                    <i class="fas fa-check-circle me-2"></i>
                                                                </c:when>
                                                                <c:when test="${aircraft.currentStatus == '维修中'}">
                                                                    <i class="fas fa-tools me-2"></i>
                                                                </c:when>
                                                                <c:otherwise>
                                                                    <i class="fas fa-ban me-2"></i>
                                                                </c:otherwise>
                                                            </c:choose>
                                                            ${aircraft.currentStatus}
                                                        </span>
                                                    </td>
                                                    
                                                    <!-- 最大座位 -->
                                                    <td>
                                                        <div class="seat-count">
                                                            <i class="fas fa-chair me-2"></i>
                                                            ${aircraft.maxSeats}
                                                        </div>
                                                    </td>
                                                    
                                                    <!-- 操作 -->
                                                    <td>
                                                        <a href="EditAircraftServlet?aircraftId=${aircraft.aircraftId}" 
                                                           class="btn-edit">
                                                            <i class="fas fa-edit me-2"></i>
                                                            编辑
                                                        </a>
                                                    </td>
                                                </tr>
                                            </c:forEach>
                                        </c:when>
                                        <c:otherwise>
                                            <tr>
                                                <td colspan="5" class="empty-state">
                                                    <i class="fas fa-plane-slash"></i>
                                                    <p>暂无飞机数据</p>
                                                </td>
                                            </tr>
                                        </c:otherwise>
                                    </c:choose>
                                </tbody>
                            </table>
                        </div>
                        <!-- 分页 -->
                        <c:if test="${box.totalPages > 1}">
                            <div class="card-footer bg-white">
                                <nav aria-label="Page navigation">
                                    <ul class="pagination justify-content-center mb-0">
                                        <li class="page-item ${box.pageNo == 1 ? 'disabled' : ''}">
                                            <a class="page-link" 
                                                href="AircraftListServlet?pageNo=${box.pageNo - 1}" 
                                                aria-label="Previous">
                                                <span aria-hidden="true">&laquo;</span>
                                            </a>
                                        </li>
                                        
                                        <c:forEach begin="1" end="${box.totalPages}" var="i">
                                            <li class="page-item ${i == box.pageNo ? 'active' : ''}">
                                                <a class="page-link" 
                                                    href="AircraftListServlet?pageNo=${i}">${i}</a>
                                            </li>
                                        </c:forEach>
                                        
                                        <li class="page-item ${box.pageNo == box.totalPages ? 'disabled' : ''}">
                                            <a class="page-link" 
                                                href="AircraftListServlet?pageNo=${box.pageNo + 1}" 
                                                aria-label="Next">
                                                <span aria-hidden="true">&raquo;</span>
                                            </a>
                                        </li>
                                    </ul>
                                </nav>
                            </div>
                        </c:if>
                    </div>
                </div>

			</div>

			<footer class="main-footer"> 2025 © Copyright by <a href="https://www.bootstrapmb.com">bootstrapMB</a>-通辽航空管理平台</footer>

		</div>
		<script src="js/jquery.min.js"></script>
		<script src="js/bootstrap.bundle.min.js"></script>
		<script src="js/moment.js"></script>

		<script src="laydate/laydate.js" type="text/javascript"></script> 
		<script>
		lay('#version').html('-v'+ laydate.v);
		laydate.render({
			elem: '#date'
		 ,range: true
		  ,theme: '#13a98c'
		});
		</script>

	</body>
</html>